package com.demo.sso.sdk.model;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.io.Serializable;

/**
 * SSO用户信息模型
 * 
 * @author SpringCloud团队
 * @version 1.0.0
 * @since 2025-01-01
 */
public class SsoUserInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 用户名
     */
    @JsonProperty("username")
    private String username;

    /**
     * 用户昵称
     */
    @JsonProperty("nickname")
    private String nickname;

    /**
     * 用户邮箱
     */
    @JsonProperty("email")
    private String email;

    /**
     * 用户手机号
     */
    @JsonProperty("phone")
    private String phone;

    /**
     * 用户头像URL
     */
    @JsonProperty("avatar")
    private String avatar;

    /**
     * 用户角色
     */
    @JsonProperty("roles")
    private String roles;

    /**
     * 用户状态（1-正常，0-禁用）
     */
    @JsonProperty("status")
    private Integer status;

    /**
     * 扩展信息
     */
    @JsonProperty("ext")
    private Object ext;

    /**
     * 用户创建时间（时间戳）
     */
    @JsonProperty("createTime")
    private Long createTime;

    /**
     * 用户最后登录时间（时间戳）
     */
    @JsonProperty("lastLoginTime")
    private Long lastLoginTime;

    public SsoUserInfo() {
    }

    public SsoUserInfo(String username, String nickname) {
        this.username = username;
        this.nickname = nickname;
    }

    // Getters and Setters

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getRoles() {
        return roles;
    }

    public void setRoles(String roles) {
        this.roles = roles;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Object getExt() {
        return ext;
    }

    public void setExt(Object ext) {
        this.ext = ext;
    }

    public Long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    public Long getLastLoginTime() {
        return lastLoginTime;
    }

    public void setLastLoginTime(Long lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    @Override
    public String toString() {
        return "SsoUserInfo{" +
                "username='" + username + '\'' +
                ", nickname='" + nickname + '\'' +
                ", email='" + email + '\'' +
                ", phone='" + phone + '\'' +
                ", avatar='" + avatar + '\'' +
                ", roles='" + roles + '\'' +
                ", status=" + status +
                ", ext=" + ext +
                ", createTime=" + createTime +
                ", lastLoginTime=" + lastLoginTime +
                '}';
    }
}